<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <title>论坛</title>

    <script  th:src="@{js/jquery/2.0.0/jquery.min.js}" src="js/jquery/2.0.0/jquery.min.js"></script>
    <link th:href="@{../css/bootstrap/3.3.6/bootstrap.min.css}" href="css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet"/>
    <script th:src="@{js/bootstrap/3.3.6/bootstrap.min.js}" src="js/bootstrap/3.3.6/bootstrap.min.js"></script>

    <script type="text/javascript" th:src="@{js/private.js}"></script>
    <link th:href="@{css/tx.css}" rel="stylesheet"/>

</head>
<body>
<canvas id="canvas"></canvas>
<script type="text/javascript" th:src="@{js/canvas.js}"></script>


<div class="container">
    <div th:replace="head::header"></div>


    <div class="row" th:each="post:${page.modelList}">
        <div class="col-xs-12">
            <div class="panel panel-info">
                <div class="panel-heading" th:text="${post.ptitle}" style="font-size: 18px;font-weight: bolder">帖子标题</div>
                <div class="panel-body" th:utext="${post.pbody}" style="height: 95px;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 4;overflow: hidden; ">
                    帖子内容<br/>
                    帖子内容<br/>
                    帖子内容<br/>

                    帖子内容<br/>
                </div>
                <div class="panel-footer" style="height: 40px;">
                    <div class="col-xs-2">
                        <span class="text-info" th:text="|发帖用户:${post.user.uname}|">发帖用户:xxx</span>
                    </div>
                    <div class="col-xs-6">
                        <span class="text-primary"
                              th:text="${post.lastreplytime==null}?|发帖时间:${#dates.format(post.psendtime,'yyyy-MM-dd HH:mm:ss')}|:|最后回复时间:${#dates.format(post.lastreplytime,'yyyy-MM-dd HH:mm:ss')}|">最后回复时间:2019-2-5-08:00:00</span>
                    </div>
                    <div class="col-xs-2">
                        <span class="badge" th:text="|回复数:${post.replyCount}|">回复数:42</span>
                    </div>
                    <div class="col-xs-1">
                        <a th:href="|/post/${post.pid}.html|">
                            <button type="button" class="btn btn-primary btn-xs">查看</button>
                        </a>
                    </div>
                    <div class="col-xs-1" th:if="${session.user!=null}?(${session.user.uid == post.user.uid}?true:${session.user.level==0}):false">
                        <a th:href="|/delete/${post.pid}|">
                            <button type="button" class="btn btn-primary btn-xs">删除</button>
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>


    <div class="row">
        <div class="col-xs-12">
            <nav>
                <ul class="pager">
                    <li class="previous" th:if="${page.currentPage!=1}"><a th:href="|?page=${page.currentPage-1}|"><span aria-hidden="true">&larr;</span> 上一页</a></li>
                    <li class="text-primary" th:text="|当前第${page.currentPage}页，共${page.pageTotal}页|">当前第1页，共4页</li>
                    <li class="next" th:if="${page.currentPage!=page.pageTotal}"><a th:href="|?page=${page.currentPage+1}|">下一页<span aria-hidden="true">&rarr;</span></a></li>
                </ul>
            </nav>
        </div>
    </div>
</div>
</body>
</html>
